V576 Incorrect format. Consider checking the second actual argument of the 'asprintf' function. The SIGNED integer type argument is expected.
QString::asprintf is not recommended for new code anyway.
/* Button press -- create waypoint, start count at 1 */
auto* w = new Waypoint(*trk);
- w->shortname = QString::asprintf("WP%06d", waypt_count()+1);
+ w->shortname = QString("WP%1").arg(waypt_count() + 1, 6, 10, QLatin1Char('0'));
waypt_add(w);
}
// In theory we would not add the waypoint to the list of
{
auto* wpt = new Waypoint;
- wpt->shortname = QString::asprintf("TP%04d", ++st->tpn);
+ wpt->shortname = QString("TP%1").arg(++st->tpn, 4, 10, QLatin1Char('0'));
wpt->latitude = lat;
wpt->longitude = lon;
} else if (!wpt->notes.isNull()) {
wpt->shortname = wpt->notes;
} else {
- wpt->shortname = QString::asprintf("WPT%03d", waypt_count());
+ wpt->shortname = QString("WPT%1").arg(waypt_count(), 3, 10, QLatin1Char('0'));
}
}